
<template>
  <div class="zhif">
    <div>
      <div class="dise">
        <span>付款给鸿包惠</span>
      </div>
      <p>金额</p>
      <div class="kuangzi">
          <span>￥</span>
          <input type="number" v-model="money" @input="moneys()" ref="input" placeholder="输入金额">
      </div>
      <p>鸿包</p>
      <div class="kuangzi">
          <span>￥</span>
          <input type="number" v-model="moneyHbao" @input="moneyHbaos()" placeholder="输入鸿包">
      </div>
       <yd-button size="large" type="primary"  :disabled="dede" @click.native="pay()">付款</yd-button>
       
    </div>
  </div>
</template>
<script>

  export default {
    name: 'sweepPay',
    data () {
      return {
          dede:true,
          money:'',
          moneyHbao:''
      }
    },
    methods: { 
      moneys(){
        console.log(this.money)
        if(this.money!=''&&this.moneyHbao!=''){
          this.dede = false
        }else{
          this.dede = true
        }
      },
      moneyHbaos(){
        console.log(this.moneyHbao)
        if(this.money!=''&&this.moneyHbao!=''){
          this.dede = false
        }else{
          this.dede = true
        }
      },
      pay: function () { 
        //  this.dede = true
         console.log(this.money,this.moneyHbao)
          window.location.href = 'http://hbh.dev.whbpkj.com/wechat/offline/pay/?money='+this.money+'&moneyHbao='+this.moneyHbao+'&openid='+this.openid+'&shopid='+this.shopid
      }
    },
    mounted(){
      this.$refs['input'].focus()
    },
    created(){
      document.title="支付"  
      this.shopid = localStorage.getItem('shopid');
      this.openid = localStorage.getItem('openid');
    }
  }
</script>
<style scoped>
.zhif{
  margin: .2rem;
  padding:0 .2rem;
  background:#fff;
  box-shadow: #f8f8f8 0 0 10px 1px;
  border-radius: 2px;
  padding-bottom: .3rem;
} 
.zhif p{
  padding-top: .3rem;
  color: #999;
  font-size: .3rem;
}
.kuangzi{
  border-bottom: 1px solid #dfdfdf;
  height: 1rem;
  display: flex;
}
.kuangzi span{
  font-weight: 700;
  font-size: .6rem;
  margin-top: .1rem;
}
.kuangzi input{
  flex: 1;
  font-size: .56rem;
  padding-left: .1rem;
  border: none;
  overflow: hidden;
}
.fukuan{
  width: 100%;
  margin: .2rem 0;
}
.dise{
  display:flex;
  justify-content: space-between;
  background: #f8f8f8;
  margin: 0 -.2rem;
  padding: .2rem;
  font-size: .32rem;
}
input::-webkit-input-placeholder {
  font-size: .4rem;
}
  </style> 
  
